//
//  HSYUserCenter.h
//  HSY
//
//  Created by 陈浩 on 2017/3/31.
//  Copyright © 2017年 金开门. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "HSYUserModel.h"
#import "HSYShopInfo.h"
#import "HSYCardInfo.h"

@interface HSYUserCenter : NSObject

@property (strong, nonatomic) HSYUserModel *appAuUser; // 本机用户model
@property (nonatomic, strong) HSYShopInfo *appBizShop; //商铺信息
@property (nonatomic, strong) HSYCardInfo *appBizCard; //商铺信息


@property(nonatomic,copy)NSString *accessToken;
@property(nonatomic,copy)NSString *encryptKey;

@property(nonatomic,copy)NSString *frozenAmount;  //冻结金额
@property(nonatomic,copy)NSString *dueSettleAmount;
@property(nonatomic,copy)NSString *totalAmount;  //总金额
@property(nonatomic,copy)NSString *available;  //可用金额

+(instancetype) instatce;

/**
 拿用户余额，也用通知（HSY_REFRESH_BALANCE）去拿余额，也可直接调appAuUser里的数据去拿（appAuUser里面的余额已此时已更新）
 
 @param success 成功block
 @param failure 失败blcok
 */
-(void)getBalanceSuccess:(void(^) (NSDictionary *info))success failure:(void(^)(NSString *errorInfo))failure;

/**
 *  从本地拿取user，并赋值给单例对象
 */
- (void)restoreUserModel;
/**
 *  将用户数据保存至Documents
 */
- (void)saveUserModelToDocuments;
/**
 *  删除本地存储的user数据
 */
- (void)removeSaveUserModelFromDocuments;


- (void)logoutWithCompletionBlock:(void(^)(BOOL result,NSString *errorStr))completionBlock;

-(void)checkAppUpDate;


@end
